﻿

namespace ST.Torch.WebApi.Application
{
    public class PageReq
    {
        /// <summary>
        /// 页码
        /// </summary>
        /// <example>1</example>
        [Required(ErrorMessage = "页码不能为空"), Range(1, int.MaxValue, ErrorMessage = "页码只能在 1 到 2147483647 之间")]
        public int page { get; set; } = 1;

        /// <summary>
        /// 页容量
        /// </summary>
        ///<example>20</example>
        [Required(ErrorMessage = "页容量不能为空"), Range(5, 200, ErrorMessage = "页码只能在 5 到 200 之间")]
        public int limit { get; set; } = 20;
        /// <summary>
        /// 排序字段
        /// </summary>
        ///<example>CreateTime</example>
        public string sort { get; set; } = "CreateTime";
        /// <summary>
        /// 排序方式, asc升序, desc降序
        /// </summary>
        ///<example>desc</example>
        public string order { get; set; } = "desc";


        /// <summary>
        /// 查询
        /// </summary>
        ///<example>desc</example>
        public string key { get; set; } = "";
    }
}